import { createSlice } from "@reduxjs/toolkit";
import { UserLevel } from "@/router/baseRouter.tsx";

const userSlice = createSlice({
  name: "user",
  initialState: {
    userLevel: UserLevel["ADMIN"],
  },
  reducers: {
    changeUser(state, action) {
      state.userLevel = action.payload;
    },
  },
});

export const { changeUser: changeUserAction } = userSlice.actions;

export default userSlice.reducer;
